package leetcode_bin_tree_test;

import bin_tree.TreeNode;

/**
 * 559. N 叉树的最大深度
 */
public class MaxDepth {
    public int maxDepth(TreeNode root) {
        if (root == null) {
            return 0;
        }
        return 1 + Math.max(maxDepth(root.left), maxDepth(root.right));
    }
}
